<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active {
            text-shadow: blue 2px 5px;
        }

        .className {
            text-align: center;
        }
    </style>
</head>

<body>
    <!-- 
        v-bind 绑定属性  默认的class与动态的class结合
     -->
    <div id="app">
        <!-- 对象语法 -->
        <h1 :class="{active: isActive}" class="className">姓名：{{userName}}</h1>
        <!-- 数组语法 -->
        <h2 :class="['active',location]">年龄：{{age}}</h2>
    </div>

    <!-- 引入vue.js -->
    <script src="../../js/vue.js"></script>

    <!-- 代码逻辑 -->
    <script>
        const dcl = {
            data() {
                return {
                    userName: 'Steve Jobs',
                    isActive: true,
                    age: 18,
                    location: 'className'
                }
            },
        }
        Vue.createApp(dcl).mount('#app');
    </script>
</body>

</html>